/****************************************************************************
   Copyright 2013 Stacy Doss

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
****************************************************************************/

%{

#include <stdarg.h>
#include <stdio.h>

#include "LefParserBase.h"
#define ____YYSTYPE std::string

int yydebug = 1;
int indent  = 0;

static void yyerror (const char *msg);
int yylex (void);

%}

%union {
    int                   i;
    float                 f;
    char*                 s;
}

%token <s> NAME
%token <i> INT
%token <f> FLOAT
%token <s> QSTRING

%token <s> RIGHTBRACKET
%token <s> RIGHTBRACE
%token <s> RIGHTPAREN
%token <s> RIGHTANGLE
%token <s> LEFTBRACKET
%token <s> LEFTBRACE
%token <s> LEFTPAREN
%token <s> LEFTANGLE

%token COLON
%token BACKSLASH
%token PERIOD
%token PIPE
%token SEMI
%token COMMA
%token QUOTE

%token VERSION
%token NAMESCASESENSITIVE
%token BUSBITCHARS
%token DIVIDERCHAR
%token UNITS
%token MANUFACTURINGGRID
%token NOWIREEXTENSIONATPIN
%token USEMINSPACING
%token CLEARANCEMEASURE
%token PROPERTYDEFINITIONS
%token LAYER
%token MAXVIASTACK
%token VIA
%token VIARULE
%token GENERATE
%token NONDEFAULTRULE
%token SPACING
%token SITE
%token MACRO
%token PIN
%token OBS
%token BEGINEXT
%token END
%token LIBRARY

%token ON
%token OFF

%token TIME
%token NANOSECONDS
%token CAPACITANCE
%token PICOFARADS
%token RESISTANCE
%token OHMS
%token POWER
%token MILLIWATTS
%token CURRENT
%token MILLIAMPS
%token VOLTAGE
%token VOLTS
%token DATABASE
%token MICRONS
%token FREQUENCY
%token MEGAHERTZ

%token MAXXY
%token EUCLIDEAN

%token RANGE
%token INTEGER
%token REAL
%token STRING

%token SAMENET
%token STACK

%token CLASS
%token COVER
%token BUMP
%token RING
%token BLOCK
%token BLACKBOX
%token PAD
%token INPUT
%token OUTPUT
%token INOUT
%token SPACER
%token AREAIO
%token CORE
%token FEEDTHRU
%token TIEHIGH
%token TIELOW
%token ANTENNACELL
%token ENDCAP
%token PRE
%token POST
%token TOPLEFT
%token TOPRIGHT
%token BOTTOMLEFT
%token BOTTOMRIGHT

%token TYPE
%token CUT
%token IMPLANT
%token MASTERSLICE
%token OVERLAP
%token ROUTING

%token ORIGIN
%token SIZE
%token BY
%token SYMMETRY
%token X
%token Y
%token R90

%token DIRECTION
%token TRISTATE

%token USE
%token SIGNAL
%token ANALOG
%token GROUND
%token CLOCK

%token N
%token S
%token E
%token W
%token FN
%token FS
%token FE
%token FW

%token RECT
%token TOPOFSTACKONLY
%token DEFAULT
%token PROPERTY
%token FOREIGN

%token TO
%token HORIZONTAL
%token WIDTH
%token VERTICAL

%token ENCLOSURE
%token METALOVERHANG
%token OVERHANG

%token RPERSQ
%token EDGECAPACITANCE
%token WIREEXTENSION
%token CPERSQDIST

%token DCCURRENTDENSITY
%token RMS
%token TABLEENTRIES
%token OXIDE4
%token ADJACENTCUTS
%token ANTENNAMODEL
%token AVERAGE
%token PWL
%token OXIDE3
%token PEAK
%token OXIDE2
%token CUTAREA
%token ANTENNACUMDIFFAREARATIO
%token OXIDE1
%token ANTENNACUMAREARATIO
%token WITHIN
%token ANTENNAAREAFACTOR
%token ACCURRENTDENSITY
%token ANTENNAAREARATIO
%token ANTENNADIFFAREARATIO

%token OFFSET
%token PITCH
%token AREA
%token USELENGTHTHRESHOLD
%token LENGTHTHRESHOLD
%token INFLUENCE
%token SPACINGTABLE
%token PARALLELRUNLENGTH
%token MINIMUMCUT
%token FROMBELOW
%token FROMABOVE
%token LENGTH
%token MAXWIDTH
%token MINWIDTH
%token MINENCLOSEDAREA
%token PROTRUSIONWIDTH
%token MAXEDGESLOTSPACING
%token FILLACTIVESPACING
%token MINIMUMDENSITY
%token DENSITYCHECKWINDOW
%token MAXCOAXIALSLOTSPACING
%token DENSITYCHECKSTEP
%token SPLITWIREWIDTH
%token MAXIMUMDENSITY
%token MAXADJACENTSLOTSPACING
%token HEIGHT
%token THICKNESS
%token SHRINKAGE
%token CAPMULTIPLIER
%token SLOTWIREWIDTH
%token SLOTWIRELENGTH
%token SLOTWIDTH
%token SLOTLENGTH

%token ANTENNASIDEAREARATIO
%token ANTENNACUMDIFFSIDEAREARATIO
%token DIFFUSEONLY
%token ANTENNACUMSIDEAREARATIO
%token ANTENNADIFFSIDEAREARATIO
%token ANTENNASIDEAREAFACTOR

%token EEQ
%token SOURCE
%token USER
%token LEQ

%token <s> VERSIONSTRING;
%token <s> DELIM;
%token <s> LEFTDELIM;
%token <s> RIGHTDELIM;

%type <s>   rightdelim
%type <s>   leftdelim

%%
lef_definition:
				version
				namescasesensitive
				busbitchars
				dividerchar
				units
				manufacturinggrid
				nowireextensionatpin
				useminspacing
				clearancemeasure
				propertydefinitions
				layers
				maxviastack
				vias
				viarules
				nondefaultrule
				spacing
				sites
				macros
				beginext
				end;

version:
				VERSION VERSIONSTRING SEMI;

namescasesensitive:
				NAMESCASESENSITIVE on_off SEMI;

on_off:
				ON | OFF;				

busbitchars:
				BUSBITCHARS QUOTE leftdelim rightdelim QUOTE SEMI;

leftdelim:
				LEFTBRACE | LEFTBRACKET | LEFTPAREN | LEFTANGLE ;

rightdelim:
				RIGHTBRACE | RIGHTBRACKET | RIGHTPAREN | RIGHTANGLE;

dividerchar:
				DIVIDERCHAR QUOTE delim QUOTE SEMI;

delim:
				COLON
				| BACKSLASH
				| PERIOD
				| PIPE;								

units:
				|
				UNITS
				units_time
				units_capacitance
				units_resistance
				units_pwoer
				units_current
				units_voltage
				units_database
				units_frequency
				END UNITS;
				
convertFactor:
				INT;
				
units_time:
				| TIME NANOSECONDS convertFactor ;

units_capacitance:
				| CAPACITANCE PICOFARADS convertFactor ;

units_resistance:
				| RESISTANCE OHMS convertFactor ;

units_pwoer:
				| POWER MILLIWATTS convertFactor ;

units_current:
				| CURRENT MILLIAMPS convertFactor ;

units_voltage:
				| VOLTAGE VOLTS convertFactor ;

units_database:
				| DATABASE MICRONS convertFactor ;

units_frequency:
				| FREQUENCY MEGAHERTZ convertFactor ;

manufacturinggrid:
				| MANUFACTURINGGRID FLOAT SEMI;

nowireextensionatpin:
				| NOWIREEXTENSIONATPIN on_off SEMI;

useminspacing:
				| USEMINSPACING OBS on_off SEMI;
				| USEMINSPACING PIN on_off SEMI;
				| USEMINSPACING OBS on_off SEMI USEMINSPACING PIN on_off SEMI;
				| USEMINSPACING PIN on_off SEMI USEMINSPACING OBS on_off SEMI;

clearancemeasure:
				| CLEARANCEMEASURE MAXXY SEMI
				| CLEARANCEMEASURE EUCLIDEAN SEMI

propertydefinitions:
				|
				PROPERTYDEFINITIONS
				propertydefinitions_list
				END PROPERTYDEFINITIONS
				
propertydefinitions_list:
				| propertydefinitions_list propertydefinition

propertydefinition:
				object_type name prop_type range prop_value;

object_type:
				LAYER | LIBRARY | MACRO | NONDEFAULTRULE | PIN | VIA | VIARULE;
				
prop_type:
				INTEGER | REAL | STRING;

range:
				| RANGE number number;

prop_value:		
				| value;


layers:
				| layers layer;

layer:
				  LAYER name TYPE CUT         SEMI cut_layer			END name
				| LAYER name TYPE IMPLANT     SEMI implant_layer		END name
				| LAYER name TYPE MASTERSLICE SEMI nonrouting_layer		END name
				| LAYER name TYPE OVERLAP     SEMI nonrouting_layer		END name
				| LAYER name TYPE ROUTING     SEMI routing_layer		END name;

cut_layer:
				cut_layer_spacing_list
				properties
				cut_layer_accurrentdensity
				cut_layer_dccurrentdensity
				antennamodel_list
				antennaarearatio_list
				antennadiffarearatio_list
				antennacumarearatio_list
				antennacumdiffarearatio_list
				cut_layer_antennaareafactor_list;

cut_layer_spacing_list:
				| cut_layer_spacing_list cut_layer_spacing;
				
cut_layer_spacing:
				SPACING number cut_layer_spacing_layer SEMI;

cut_layer_spacing_layer:
				| LAYER name
				| ADJACENTCUTS INT WITHIN number;

cut_layer_accurrentdensity:
				| ACCURRENTDENSITY accurrentdensity_type
				cut_layer_accurrentdensity_value SEMI;

accurrentdensity_type:
				PEAK | AVERAGE | RMS;

cut_layer_accurrentdensity_value:
				number
				| 
				FREQUENCY numbers SEMI
				cut_layer_accurrentdensity_value_cutarea_optional
				TABLEENTRIES numbers SEMI;

cut_layer_accurrentdensity_value_cutarea_optional:
				| CUTAREA numbers SEMI;

cut_layer_dccurrentdensity:
				| DCCURRENTDENSITY AVERAGE 
				cut_layer_dccurrentdensity_values 
				SEMI;

cut_layer_dccurrentdensity_values:
				number
				| cutarea_list SEMI tableentries_list;

cutarea_list:
				CUTAREA numbers;

tableentries_list:
				TABLEENTRIES numbers;

cut_layer_antennaareafactor_list:
				| cut_layer_antennaareafactor_list cut_layer_antennaareafactor;

cut_layer_antennaareafactor:
				ANTENNAAREAFACTOR number SEMI;

implant_layer:
				WIDTH number SEMI
				implant_layer_spacing_list
				properties;

implant_layer_spacing_list:
				| implant_layer_spacing_list implant_layer_spacing;

implant_layer_spacing:
				SPACING number opt_layer_name SEMI;

opt_layer_name:
				| LAYER name;
				
nonrouting_layer:
				properties;

routing_layer:
				direction
				pitch
				width
				offset
				area
				spacing_list
				spacingtable_list
				wireextension
				minimumcut_list
				max_width
				min_width
				minenclosedarea_list
				protusionwidth
				resistance
				capacitance
				height
				thickness
				shrinkage
				capmultiplier
				edgecapacitance
				slotwirewidth
				slotwirelength
				slotwidth
				slotlength
				maxadjacentslotspacing
				maxcoaxialslotspacing
				maxedgeslotspacing
				splitwirewidth
				minimundensity
				maximundensity
				densitycheckwindow
				densitycheckstep
				fillactivespacing
				antennaarearatio_list
				antennadiffarearatio_list
				antennacumarearatio_list
				antennacumdiffarearatio_list
				antennaareafactor_list
				antennasidearearatio_list
				antennadiffsidearearatio_list
				antennacumsidearearatio_list
				antennacumdiffsidearearatio_list
				antennasideareafactor_list
				properties
				accurrentdensity
				dccurrentdensity;
				
direction:
				DIRECTION h_or_v SEMI

pitch:
				PITCH number SEMI;
				
width:
				WIDTH number SEMI

offset:
				| OFFSET number SEMI;
				
area:
				| AREA number SEMI;
				
spacing_list:
				| spacing_list layer_spacing;

layer_spacing:
				SPACING
				optional_range_phrase
				SEMI;

optional_range_phrase:
				| RANGE number number threshhold_def;

threshhold_def:
				uselengththreshold | lengththreshhold;

uselengththreshold:
				USELENGTHTHRESHOLD
				| INFLUENCE value optional_range
				| optional_range;

optional_range:
				| RANGE number number;
				
lengththreshhold:
				LENGTHTHRESHOLD number optional_range;

spacingtable_list:
				| spacingtable_list spacingtable;

spacingtable:
				SPACINGTABLE
				PARALLELRUNLENGTH numbers
				spacingwidth_list
				spacingtable_influence
				SEMI;

spacingwidth_list:
				spacingwidth SEMI;
				| spacingwidth_list spacingwidth SEMI;

spacingwidth:
				WIDTH number numbers;

spacingtable_influence:
				SPACINGTABLE INFLUENCE influence_list SEMI;

influence_list:
				influence
				| influence_list influence;

influence:
				WIDTH number WITHIN number SPACING number;

wireextension:
				| WIREEXTENSION number SEMI;

minimumcut_list:
				| minimumcut_list minimumcut;

minimumcut:
				MINIMUMCUT number WIDTH number
				from_above_below
				optional_length_within
				SEMI;

from_above_below:
				FROMABOVE | FROMBELOW;
				
optional_length_within:
				| LENGTH number WITHIN number;

max_width:
				| MAXWIDTH number SEMI;

min_width:
				| MINWIDTH number SEMI;
				
minenclosedarea_list:
				| minenclosedarea_list minenclosedarea;

minenclosedarea:
				MINENCLOSEDAREA number optional_width SEMI;

optional_width:
				| WIDTH number;
				
protusionwidth:
				| PROTRUSIONWIDTH number LENGTH number WIDTH number SEMI;

resistance:
				| RESISTANCE RPERSQ number SEMI;

capacitance:
				| CAPACITANCE CPERSQDIST number SEMI;

height:
				| HEIGHT number SEMI;

thickness:
				| THICKNESS number SEMI;

shrinkage:
				| SHRINKAGE number SEMI;

capmultiplier:
				| CAPMULTIPLIER number SEMI;

edgecapacitance:
				| EDGECAPACITANCE number SEMI;

slotwirewidth:
				| SLOTWIREWIDTH number SEMI;

slotwirelength:
				| SLOTWIRELENGTH number SEMI;

slotwidth:
				| SLOTWIDTH number SEMI;

slotlength:
				| SLOTLENGTH number SEMI;

maxadjacentslotspacing:
				| MAXADJACENTSLOTSPACING number SEMI;

maxcoaxialslotspacing:
				| MAXCOAXIALSLOTSPACING number SEMI;

maxedgeslotspacing:
				| MAXEDGESLOTSPACING number SEMI;

splitwirewidth:
				| SPLITWIREWIDTH number SEMI;

minimundensity:
				| MINIMUMDENSITY number SEMI;

maximundensity:
				| MAXIMUMDENSITY number SEMI;

densitycheckwindow:
				| DENSITYCHECKWINDOW number number SEMI;

densitycheckstep:
				| DENSITYCHECKSTEP number SEMI;

fillactivespacing:
				| FILLACTIVESPACING number SEMI;

antennamodel_list:					| antennamodel_list antennamodel;
antennaarearatio_list:				| antennaarearatio_list antennaarearatio;
antennadiffarearatio_list:			| antennadiffarearatio_list antennadiffarearatio;
antennacumarearatio_list:			| antennacumarearatio_list antennacumarearatio;
antennacumdiffarearatio_list:		| antennacumdiffarearatio_list antennacumdiffarearatio;
antennaareafactor_list:				| antennaareafactor_list antennaareafactor;
antennasidearearatio_list:	 		| antennasidearearatio_list antennasidearearatio;
antennadiffsidearearatio_list: 		| antennadiffsidearearatio_list antennadiffsidearearatio;
antennacumsidearearatio_list: 		| antennacumsidearearatio_list antennacumsidearearatio;
antennacumdiffsidearearatio_list: 	| antennacumdiffsidearearatio_list antennacumdiffsidearearatio;
antennasideareafactor_list: 		| antennasideareafactor_list antennasideareafactor;

antennamodel:
				ANTENNAMODEL antennamodel_type SEMI;

antennamodel_type:
				OXIDE1 | OXIDE2 | OXIDE3 | OXIDE4 ;
				

antennaarearatio:
				ANTENNAAREARATIO number SEMI;
				
antennadiffarearatio:
				ANTENNADIFFAREARATIO  number_or_pwl SEMI;

antennacumarearatio:
				ANTENNACUMAREARATIO number SEMI;
				
antennacumdiffarearatio:
				ANTENNACUMDIFFAREARATIO number_or_pwl SEMI;
				
antennaareafactor:
				ANTENNAAREAFACTOR number optional_diffuseonly SEMI;
				
antennasidearearatio:
				ANTENNASIDEAREARATIO number SEMI;

antennadiffsidearearatio:
				ANTENNADIFFSIDEAREARATIO number_or_pwl SEMI;

antennacumsidearearatio:
				ANTENNACUMSIDEAREARATIO number SEMI;
				
antennacumdiffsidearearatio:
				ANTENNACUMDIFFSIDEAREARATIO number_or_pwl SEMI;
				
antennasideareafactor:		
				ANTENNASIDEAREAFACTOR number optional_diffuseonly SEMI;

piece_wise_linear:
				PWL LEFTPAREN area_and_ratio_list RIGHTPAREN;

area_and_ratio_list:
				area_and_ratio
				| area_and_ratio_list area_and_ratio;
				
area_and_ratio:
				LEFTPAREN number number RIGHTPAREN;
				
number_or_pwl:
				number | piece_wise_linear;
				
optional_diffuseonly:
				DIFFUSEONLY;
							
accurrentdensity:
				| ACCURRENTDENSITY 
				accurrentdensity_type
				accurrentdensity_value 
				SEMI;

accurrentdensity_value:
				number
				| FREQUENCY numbers SEMI
				optional_accurrentdensity_value_width
				TABLEENTRIES numbers SEMI;

optional_accurrentdensity_value_width:
				| WIDTH numbers SEMI;


dccurrentdensity:
				| DCCURRENTDENSITY AVERAGE 
				dccurrentdensity_values 
				SEMI;

dccurrentdensity_values:
				number
				| width_list SEMI tableentries_list;

width_list:
				WIDTH numbers;



maxviastack:
				| MAXVIASTACK INT
				| MAXVIASTACK INT RANGE value value SEMI;

vias:
				| vias via;

via:
				VIA name
				via_default
				via_topofstackonly
				via_foreign
				via_resistance
				via_layers
				properties
				END name;

via_default:
				| DEFAULT;

via_topofstackonly:
				| TOPOFSTACKONLY;

via_foreign:
				| FOREIGN name via_optional_pt SEMI;

via_optional_pt:
				| point via_optional_orient;
								
via_optional_orient:
				| {expect_orient = 1; } orient;

via_resistance:
				| RESISTANCE number SEMI;

via_layers:
				via_layer
				| via_layers via_layer;

via_layer:
				LAYER name SEMI
				via_rects;

via_rects:
				via_rect
				| via_rects via_rect;

via_rect:
				RECT point point SEMI;
				
orient:
				N | S | E | W | FN | FS | FE | FW;

point:
				number number;

properties:
				| properties property;
				
property:
				PROPERTY name value SEMI;

viarules:
				| viarules viarule 
				| viarules viarulegenerate;
				
viarule:
				VIARULE name
				viarule_layer
				viarule_layer
				viarule_vias
				properties
				END name ;

viarule_layer:
				LAYER name SEMI
				direction
				viarule_width SEMI;

h_or_v:
				HORIZONTAL | VERTICAL;

viarule_width:
				| WIDTH number TO number ;

viarule_vias:
				viarule_via
				| viarule_vias viarule_via;

viarule_via:
				VIA name SEMI;

viarulegenerate:
				VIARULE name GENERATE
				viarulegenerate_layer
				viarulegenerate_layer
				viarulegenerate_cut
				END name ;

viarulegenerate_layer:
				LAYER name SEMI
				DIRECTION h_or_v SEMI
				overhang
				viarulegenerate_width

overhang:
				overhang1 | overhang2;
				
overhang1:
				| OVERHANG number SEMI
				| METALOVERHANG number SEMI
				| OVERHANG number SEMI METALOVERHANG number SEMI;
				
overhang2:
				ENCLOSURE number number SEMI

viarulegenerate_width:
				| WIDTH number TO number SEMI

viarulegenerate_cut:
				LAYER name SEMI
				RECT point point SEMI
				SPACING number BY number SEMI
				viarulegenerate_cut_resistance;

viarulegenerate_cut_resistance:
				| RESISTANCE number SEMI;

nondefaultrule:
				|
				NONDEFAULTRULE name
				nondefaultrule_layers
				nondefaultrule_vias
				spacing
				properties
				END

nondefaultrule_layers:
				nondefaultrule_layer
				| nondefaultrule_layers nondefaultrule_layer

nondefaultrule_layer:
				LAYER name
				WIDTH number SEMI
				SPACING number SEMI
				nondefaultrule_wireextension
				resistance
				capacitance
				edgecapacitance
				END name;

nondefaultrule_wireextension:
				| WIREEXTENSION number SEMI;

nondefaultrule_vias:
				nondefaultrule_via
				| nondefaultrule_vias nondefaultrule_via;

nondefaultrule_via:
				via;

spacing:
				| 
				SPACING
				samenet_list
				END SPACING;

samenet_list:
				| samenet_list samenet;

samenet:
				SAMENET name name FLOAT SEMI
				| SAMENET name name FLOAT STACK SEMI

sites:
				| sites site;
				
site:
				SITE name
				CLASS pad_core SEMI
				symmetry SEMI
				SIZE number BY number SEMI
				END SITE;

pad_core:
				PAD | CORE ;

symmetry:
				SYMMETRY symmetry_types;
	
symmetry_types:
				symmetry_type
				| symmetry_types symmetry_type;
				
symmetry_type:					
				X | Y | R90;

macros:
				| macros macro ;

macro:
				MACRO name CLASS classtype SEMI
				macro_source
				macro_foreign
				macro_origin
				macro_eeq
				macro_leq
				macro_size
				macro_symmetry
				macro_site
				pins
				obss
				properties
				END name;

classtype:
				COVER cover_class
				| RING
				| BLOCK block_class
				| PAD pad_class
				| CORE core_class
				| ENDCAP endcap_class;

cover_class:
				| BUMP;

block_class:
				| BLACKBOX;

pad_class:
				| INPUT | OUTPUT |INOUT | POWER | SPACER | AREAIO ;

core_class:
				| FEEDTHRU | TIEHIGH | TIELOW | SPACER | ANTENNACELL;

endcap_class:
				PRE | POST | TOPLEFT | TOPRIGHT | BOTTOMLEFT | BOTTOMRIGHT;				


macro_source:
				| SOURCE USER SEMI
				| SOURCE BLOCK SEMI;

macro_foreign:
				| FOREIGN name macro_point_optional SEMI;

macro_point_optional:
				| point macro_orient_optional;
								
macro_orient_optional:
				| orient;
				
macro_origin:
				| ORIGIN point SEMI;
				
macro_eeq:
				| EEQ name SEMI;

macro_leq:
				| LEQ name SEMI;

macro_size:
				| SIZE number BY number SEMI

macro_symmetry:
				| SYMMETRY semmetry_defs SEMI;

semmetry_defs:
				semmetry_def
				| semmetry_def semmetry_defs;

semmetry_def:
				X | Y | R90;

macro_site:
				SITE name SEMI;
				
pins:
				| pin pins;

pin:
				PIN name pin_attributes END name;

pin_attributes:
				| pin_attribute pin_attributes;

pin_attribute:
				pin_direction
				| pin_use;

pin_direction:
				DIRECTION direction_def SEMI;

direction_def:
				INPUT
				| OUTPUT
				| OUTPUT TRISTATE
				| INOUT
				| FEEDTHRU;
				
pin_use:
				USE use_def SEMI;

use_def:
				SIGNAL
				| ANALOG
				| POWER
				| GROUND
				| CLOCK;

obss:
				| obs obss;

obs:
				OBS statement;

beginext:
				| BEGINEXT statement;

end:			END LIBRARY;

statement:
				{ printf("-\n"); }

names:
				name
				| names name;

numbers:
				number
				| numbers number;

name:
				NAME;

number:
				INT | FLOAT;
				
value:
				name
				| number;


%%


int main () {
	yyparse ();
	printf("FINISHED!\n");
}

void yyerror(const char* errstr) {
	printf("YUCK Error: %i, %s, %s\n", line_number, yylval, errstr);
}
